package com.campus.counseling.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.Arrays;

@Data
@ApiModel(description = "用户信息VO")
public class UserVO {

    @ApiModelProperty("用户ID")
    private Long id;

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("真实姓名")
    private String realName;

    @ApiModelProperty("性别")
    private Integer gender;

    @ApiModelProperty("手机号码")
    private String phone;

    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("角色")
    private String role;

    @ApiModelProperty("所在地区")
    private List<String> region;

    public void setRegion(String region) {
        if (region != null && !region.trim().isEmpty()) {
            this.region = Arrays.asList(region.split(","));
        }
    }

    public List<String> getRegion() {
        return region;
    }

    @ApiModelProperty("详细地址")
    private String address;

    @ApiModelProperty("个人简介")
    private String bio;
}